import { defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid";
// import devtools from 'solid-devtools/vite';
import UnocssPlugin from "@unocss/vite";
import path from "path";

export default defineConfig({
  plugins: [
    /* 
    Uncomment the following line to enable solid-devtools.
    For more info see https://github.com/thetarnav/solid-devtools/tree/main/packages/extension#readme
    */
    // devtools(),
    solidPlugin(),
    UnocssPlugin(),
  ],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./src"),
      "~/com": path.resolve(__dirname, "./public_modules/components"),
      "~/hooks": path.resolve(__dirname, "./public_modules/hooks"),
      "~/tools": path.resolve(__dirname, "./public_modules/tools"),
    },
  },
  server: {
    port: 3000,
  },
  build: {
    emptyOutDir: true,
    target: "esnext",
    copyPublicDir: false,
  },
});
